import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/wb";

// 查询考试大类列表
export function listExamstype(data) {
  return request({
    url: '/examstype/list',
    method: 'post',
    data
  })
}

// 查询考试大类详细
export function getExamstype(id) {
  return request({
    url: '/examstype/' + parseStrEmpty(id),
    method: 'get'
  })
}

// 新增考试大类
export function addExamstype(data) {
  return request({
    url: '/examstype/add',
    method: 'post',
    data
  })
}

// 修改考试大类
export function updateExamstype(data) {
  return request({
    url: '/examstype/update',
    method: 'post',
    data
  })
}

// 删除考试大类（支持批量）
export function delExamstype(idOrIds) {
  const ids = Array.isArray(idOrIds) ? idOrIds : [idOrIds]
  return request({
    url: '/examstype/deleteAll',
    method: 'delete',
    data: { ids }
  })
}

